using System.ComponentModel.DataAnnotations;

namespace WL.Think.Abp.Dto
{
    public class BaseCategoryMoveDto : BaseDto
    {
        /// <summary>
        /// 移动ID
        /// </summary>
        [Required(AllowEmptyStrings = false, ErrorMessage = "移动的对象必须存在")]
        public Guid MoveId { get; set; }

        /// <summary>
        /// 移动目标ID
        /// </summary>
        [Required(AllowEmptyStrings = false, ErrorMessage = "移动的目的必须存在")]
        public Guid DestId { get; set; }

        /// <summary>
        /// 移动位置
        /// </summary>
        public MovePositionEnum Position { get; set; }

        /// <summary>
        /// 判断是验证有效
        /// </summary>
        /// <returns></returns>
        public bool IsCanMoving()
        {
            return MoveId != Guid.Empty && DestId != Guid.Empty && MoveId != DestId;
        }
    }

    /// <summary>
    /// 移动位置枚举
    /// </summary>
    public enum MovePositionEnum
    {
        /// <summary>
        /// 在什么之前
        /// </summary>
        BEFORE = 0,
        /// <summary>
        /// 在什么之后
        /// </summary>
        AFTER = 1,
        /// <summary>
        /// 在什么里面
        /// </summary>
        INSIDE = 2,
    }
}
